import React, { Component } from 'react';
import '../styles/MyEntry.scss'
import tu from '../assets/102.gif'
import * as service from '../api/index'



class MyEntry extends Component {
    constructor(props){
        super(props);
        this.state = { 
            tu:tu,
            list:[]
        }
    }
    async componentDidMount(){
        var res=await service.index_nav()
        this.setState({list:res.data.list})
    }
    render() {
        return (
            <div className='entry'>
                <div className='zi'>
                    <span className='iconfont icon-yangshengqi'></span> 
                    1分抵1元。请您点击此处查看《购物须知》。</div>
                <div className='nei'> 
                {
                    this.state.list.map((item,index)=>{
                        return (
                            <div className="item" key={index}>
                                <img src={item.pic} alt="" />
                                <div className="text">{item.name}</div>
                            </div>
                        )
                    })
                }
                </div>
                <div className='tu'>
                    <img src={tu} alt="" />
                </div>
            </div>
        );
    }
}

export default MyEntry;